<div ng-controller="memberMngCtrl">
    <h1 class="page-header">会员管理</h1>

    <div class="row">
        <div class="col-xs-6 col-sm-6">
            <button type="button" class="btn col-xs-3" ui-sref="index.memberForm" style="margin-bottom: 30px; background-color: #33a88d !important; color: #fff;">新增</button>
        </div>
    </div>

    <div class="row">

        <div class="col-xs-3 col-sm-3">
            <div class="form-group">
                <label>姓名: </label>
                <input class="form-control" ng-model="search.real_name" style="display:inline; width: 80%;"/>
            </div>
        </div>

        <div class="col-xs-3 col-sm-3">
            <div class="form-group">
                <label>手机号: </label>
                <input class="form-control" ng-model="search.phone_mob" style="display:inline; width: 80%;"/>
            </div>
        </div>

        <div class="col-xs-3 col-sm-3">
            <div class="form-group" >
                <label>归属: </label>
                <input class="form-control" ng-model="search.ascription" style="display:inline; width: 80%;" ng-readonly="ascription"/>
            </div>
        </div>

        <div class="col-xs-3 col-sm-3">
            <div class="form-group">
                <span class="input-group-btn">
                    <button class="btn btn-primary" type="button" ng-click="getPagedDataAsync()">
                        搜索
                    </button>
                </span>
            </div>
        </div>

    </div>
    <div class="row">
        <table class="table table-bordered top5">
            <thead>
            <tr>
                <th class="col-xs-2">姓名</th>
                <th class="col-xs-2">手机号</th>
                <th class="col-xs-1">积分</th>
                <th class="col-xs-2">归属</th>
                <th class="col-xs-2">用户等级</th>
                <th class="col-xs-1">用户状态</th>
                <th class="col-xs-2">操作</th>
            </tr>
            </thead>

            <tbody>
            <tr ng-repeat="item in list">
                <td ng-bind="item.real_name"></td>
                <td ng-bind="item.phone_mob"></td>
                <td ng-bind="item.scores"></td>
                <td ng-bind="item.ascription"></td>
                <td ng-bind="item.levelName"></td>
                <td >{{item.status ? "有效" : "冻结"}}</td>
                <td>
                    <a ui-sref="index.memberForm({id:item.user_id})" class="btn btn-sm">编辑用户详情</a>
                    <a ng-click="updateStatus(item.user_id)" class="btn btn-sm" >{{item.status ? "禁用" : "启用"}}</a>
                </td>
            </tr>
            </tbody>
        </table>

        <pagination boundary-links="true"
                    max-size="5"
                    items-per-page="search.pageSize"
                    total-items="count"
                    ng-model="pageIndex"
                    ng-change="pagedCallback()"></pagination>
    </div>
</div>